@extends('admin.layout.base')
@section('add_css')

@endsection
@section('content')
    @include('admin.'.$controller_base_lower.'.form')
    @include('admin.layout.table')
@endsection
@section('foot_js')
    @include('admin.layout.ListConfig')
    <script>

        layui.use(['index', 'listTable'], function () {
            var $ = layui.$
                , listTable = layui.listTable;
            cols = [[
                {type: 'checkbox'}
                , {field: 'id', width: 80, title: 'ID', sort: true}
                , {field: 'area', title: '地区', templet: function (d) {
                            var arr = {
                                1:'香港'
                            };
                            return layui_label(arr[d.area], d.area == 1 ? 'success' : 'warning')
                        }
                    }
                , {field: 'server_name', title: '服务器名称', edit: 1}
                , {field: 'price', title: '价格/月', edit: 1}
                , {field: 'server_type', title: '操作系统', templet: function (d) {
                        var arr = {
                            1:'Linux',
                            2:'Windows',
                        };
                        return layui_label(arr[d.server_type], d.server_type == 1 ? 'success' : 'warning')
                    }
                }
                , {title: '操作', width: 200, align: 'center', toolbar: '#tpl-create-edit'}
            ]]
            //渲染
            listTable.render(listConfig.index_url, cols);
            //监听搜索
            listTable.search();


        });
    </script>
@endsection